package net.child.chess.pieces;

import java.util.List;
import net.child.chess.utils.ChessDef;

abstract public class Pown extends Piece
{
	public Pown(ChessDef.Color color, PieceState state, int imageId)
	{
		super(color, Piece.Type.POWN, state, imageId);
	}
	
	//	In general the "pown" could attack diagonal square if isn't empty and
	//	there is opponent's piece. this function is checking that.
	@Override
	protected void addAttackIfValid(List<Integer> squares, int to, IMoves iMoves) 
	{
		if(iMoves.isOpponentSquare(color(), to))
		{
			squares.add(to);
		}
	}
}
